package com.gzsxy.esjy.message.mds.decoder;

import com.alibaba.fastjson.JSON;

import com.gzsxy.esjy.message.mds.dto.MdsMessage;
import com.gzsxy.esjy.message.netty.decoder.WebsocketDecoder;
import io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker;
import lombok.extern.slf4j.Slf4j;

/**
 * mds 专属消息解析
 */
@Slf4j
public class MdsDecoder extends WebsocketDecoder {

    private final String mds ;

    public MdsDecoder(WebSocketServerHandshaker handshaker,String url) {
        super(handshaker);
        this.mds = url ;
    }

    @Override
    protected Object decode(String request) {
        return JSON.parseObject(request, MdsMessage.class);
    }

}
